#include <boost/interprocess/ipc/message_queue.hpp>
#include <iostream>
#include <vector>

;

int main ()
{
   try{
      //Erase previous message queue
      boost::interprocess::message_queue::remove("message_queue");

      //Create a message_queue.
      boost::interprocess::message_queue mq
         (boost::interprocess::create_only               //only create
         ,"message_queue"           //name
         ,200                       //max message number
         ,sizeof(int)               //max message size
         );

      //Send 100 numbers
      for(int i = 0; i < 100; ++i){
         mq.send(&i, sizeof(i), 0);
      }
   }
   catch(boost::interprocess::interprocess_exception &ex){
      std::cout << ex.what() << std::endl;
      return 1;
   }

   return 0;
}